package net.heavencraft.bejeweled.jewel;

import net.heavencraft.bejeweled.Bejeweled;

/**
 * Represents a Jewel that will explode on remove and will trigger any nearby
 * blocks
 * 
 * @author Sven
 * @author Wesley
 * 
 */
public class CreeperJewel extends Jewel {

	/**
	 * Initializes a CreeperJewel This constructor has no difference from Jewel
	 */
	public CreeperJewel(Bejeweled main, JewelColor color) {
		super(main, color);

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * net.heavencraft.bejeweled.jewel.Jewel#remove(net.heavencraft.bejeweled
	 * .jewel.Jewel)
	 */
	@Override
	public int remove(Jewel source) {
		int score = 0;
		for (Jewel j : grid.get3x3(this)) {
			if (j == null || j.equals(source))
				continue;
			score += j.remove(this);
		}
		score += super.remove(source);
		return score;
	}

}
